package org.gitos.cloud.server.rpc;

import java.util.List;

import org.gitos.cloud.domain.rpc.BRomRPC;
import org.gitos.cloud.domain.server.Rom;
import org.gitos.cloud.server.service.RomService;
import org.gitos.cloud.util.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;

/**
 * Created by shizhengchu on 16/1/18.
 */
@Service
public class BRomRpcImp extends CommonMethod implements BRomRPC {

	private static Logger log = LoggerFactory.getLogger(BRomRpcImp.class);

	@Autowired
	private RomService romService;

	@Override
	public void addRom(String name, String version, int type, String url) {
		romService.addRom(name, version, type, url);
	}

	@Override
	public Pagination<Rom> list(int pageNumber, int pageSize, int type, String sortName, String sortOrder) {
		List<Rom> roms = romService.list(pageNumber, pageSize, type, sortName, sortOrder);
		return new Pagination<Rom>(roms);
	}

}
